import { onMounted, onUnmounted, reactive } from "vue";
export default () => {
    let point = reactive({
        X: 0,
        Y: 0,
    });

    let savePoint = (e) => {
        point.X = e.pageX;
        point.Y = e.pageY;
        console.log(e.pageX, e.pageY);
    };

    onMounted(() => {
        window.addEventListener("click", savePoint);
    });

    onUnmounted(() => {
        window.removeEventListener("click", savePoint);
    });

    return point
}